<template>
  <div>
    <el-container>
      <el-header><top-bar></top-bar></el-header>
      <el-main
        ><search-bar @queryData="queryData"> </search-bar
        ><slideshow></slideshow>
        <search-result v-if="getQueryData.length>0" :getQueryData="getQueryData"></search-result
        ><recommend></recommend>
      </el-main>
      <el-footer>Footer</el-footer>
    </el-container>
  </div>
</template>

<script>
import TopBar from "./TopBar/TopBar.vue";
import SearchBar from "./SearchBar/SearchBar.vue";
import Slideshow from "./Slideshow/Slideshow.vue";
import Recommend from "./Views/Recommend.vue";
import SearchResult from "./Views/SearchResult.vue";

export default {
  components: {
    TopBar,
    SearchBar,
    Slideshow,
    Recommend,
    SearchResult,
  },
  data() {
    return {
      getQueryData: [],
    };
  },
  methods: {
    queryData(val) {
      this.getQueryData = val;
    },
  },
};
</script>
<style scoped>
.el-header,
.el-footer {
  background-color: #333;
  color: #333;
  text-align: center;
  line-height: 40px;
}
.el-header {
  height: 40px !important;
  padding: 0 120px;
}

.el-main {
  background-color: whitesmoke;
  color: #333;
  text-align: center;
  /* line-height: 160px; */
  min-height: 750px;
  height: 100%;
  padding: 0;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>